package com.xjt.sentinel.controller.dashboar;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: xu
 * @Description: TODO
 * @Date: 2021/11/14 21:52
 */

@RestController
public class dashboartController
{

	@GetMapping("dashboard")
//	@SentinelResource(value = "dashboard",blockHandler = "testdashboard",fallback = "testdashboardException")
	public String dashboard()
	{
		return "这是配置sentinel得可视化配置界面控制台使用。dashboard";
	}

	public String testdashboard(BlockException e)
	{
		e.printStackTrace();
		return "当前服务已熔断降级";
	}

	public String testdashboardException()
	{
		return "服务异常执行方法调用";
	}
}
